package com.qing.expert.modules.notification.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qing.expert.modules.notification.entity.Notification;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface NotificationMapper extends BaseMapper<Notification> {

    /**
     * 将用户所有未读消息标记为已读
     */
    @Update("UPDATE notification SET is_read = 1 WHERE user_id = #{userId} AND is_read = 0")
    void markAllRead(String userId);
}